// 0001.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
/*Satellite Photographs 

  Time Limit:   1000MS       Memory Limit:   65535KB 
  Submissions:   300       Accepted:   196 
  
	
	  DescriptionFarmer John purchased satellite photos of W x H pixels of his farm (1  <= W <= 80, 1 <= H <= 1000) and wishes to determine the  largest 'contiguous' (connected) pasture. Pastures are contiguous when  any pair of pixels in a pasture can be connected by traversing adjacent  vertical or horizontal pixels that are part of the pasture.  (It is easy  to create pastures with very strange shapes, even circles that surround  other circles.)   Each photo has been digitally enhanced to show pasture area as an  asterisk ('*') and non-pasture area as a period ('.').  Here is a 10 x 5  sample satellite photo:   ..*.....**  .**..*****  .*...*....  ..****.***  ..****.***   This photo shows three contiguous pastures of 4, 16, and 6 pixels.  Help FJ find the largest contiguous pasture in each of his satellite  photos. 
	  Input* Line 1: Two space-separated integers: W and H  * Lines 2..H+1: Each line contains W "*" or "." characters  representing one raster line of a satellite photograph.
	  
		Output* Line 1: The size of the largest contiguous field in the satellite  photo. 
		Sample Input
		10 5
		..*.....**
		.**..*****
		.*...*....
		..****.***
		..****.***
		Sample Output
		16
		Hint 
Source 
*/

#include <stdio.h>
char a[1001][81];
int k;
//int b[4][2]={{1,0},{-1,0},{0,-1},{0,1}};
int xoffset[4] = {0, 0, 1, -1};
int yoffset[4] = {1, -1, 0, 0};
void DFS(int x,int y,int m,int n)
{
	int ty,tx,i;
	a[x][y]='.';
	k++;
	for(i=0;i<4;i++)
	{
		//tx=x+b[i][0];
		//ty=y+b[i][1];
		tx = x + xoffset[i];
		ty = y + yoffset[i];
		if(tx>=0 && tx<m && ty>=0 && ty<n && a[tx][ty]=='*')
		{
			DFS(tx,ty,m,n);
		}
	}
}
int main()
{
	int i,j,w,h,max=0;
	scanf("%d %d",&w,&h);
	getchar();
	for(i=0;i<h;i++)
	{
		gets(a[i]);
	}
	for(i=0;i<h;i++)
	{
		for(j=0;j<w;j++)
		{
			if(a[i][j]=='*')
			{
				k=0;
				DFS(i,j,h,w);
				if(k>max)
				{
					max=k;
				}
			}
		}
	}
	printf("%d\n",max);
	return 0;
}
